﻿using System.Collections.Generic;
using OWE.Core.Domain;
using OWE.Core.Domain.Security;

namespace OWE.Service.Security
{
    public interface IPermissionService
    {
        void DeletePermissionItem(PermissionItem permission);

        PermissionItem GetPermissionItemById(int permissionId);

        PermissionItem GetPermissionItemBySystemName(string systemName);

        IList<PermissionItem> GetAllPermissionItems();

        void InsertPermissionItem(PermissionItem permission);

        void UpdatePermissionItem(PermissionItem permission);

        void InstallPermissions(IPermissionProvider permissionProvider);

        void UninstallPermissions(IPermissionProvider permissionProvider);

        bool Authorize(PermissionItem permission);

        bool Authorize(PermissionItem permission, User user);

        bool Authorize(string permissionItemSystemName);

        bool Authorize(string permissionItemSystemName, User user);
    }
}
